from util import Logger


class MyExceptionHandler:
    def __init__(self):
        pass

    def postException(self, func_name, exception):
        try:
            msg = "{}....{}".format(func_name, exception)
        except Exception as e:
            msg = "{}....{}".format(self.__qualname__, e)
        Logger.logger(msg)
        response = {}
        response["code"] = 500
        response["msg"] = "服务器异常，请联系管理员...{}".format(msg)
        return response
